package com.newzqxq.common.enums;
import com.sun.media.sound.SoftTuning;
import lombok.Data;

/**
 * @author 石清
 * @Description  0英语、1印尼语、2中文
 * @create 2017-12-04 12:23
 **/
public enum  LanguageEnums {
    ENGLISH(0,"英语"),
    INDONESIA(1,"印尼语"),
    CHINESE(2,"中文");
    private Integer code;
    private String message;

    LanguageEnums(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    public static LanguageEnums getOrderEnumsByCode(int code){
        for (LanguageEnums enums:LanguageEnums.values()){
            if (enums.getCode()==code){
                return enums;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        LanguageEnums enums=LanguageEnums.getOrderEnumsByCode(1);
        System.out.println(enums.getCode()+enums.getMessage());
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
